//=============================================================================

#include "../../../../inc/aAction.h"

//=============================================================================

aAction::aAction() : type(ACT_NONE), dataPtr(0)
{
}

//=============================================================================

void aAction::aaPrepareAction(const aActionPush& act)
{
  aActionPush* tmpAction = new aActionPush();

  tmpAction->f = act.f;
  tmpAction->n = act.n;
  tmpAction->from = act.from;
  type = tmpAction->type;

  dataPtr = (void*)tmpAction;
}

//=============================================================================

void aAction::aaClearAction()
{
  if (dataPtr)
  {
    switch(type)
    {
      case ACT_PUSH:
      {
        delete (aActionPush*)dataPtr;

        dataPtr = 0;

        break;
      }
      default:
      {
        break;
      }
    }
  }
}

//=============================================================================

aAction::~aAction()
{
  aaClearAction();
}

//=============================================================================
